package com.zy;

import dev.langchain4j.community.model.dashscope.WanxImageModel;
import dev.langchain4j.data.image.Image;
import dev.langchain4j.model.output.Response;

/**
 * @program: AI_langchain4j
 * @description: 利用阿里千问模型来实现文本生图
 * @author: zy
 * @create: 2025-06-22 10:14
 */
public class _03_Qwen_text2Image {
    public static void main(String[] args) {

        WanxImageModel wanxImageModel= WanxImageModel.builder()
                .apiKey(  System.getenv("ALI_AI_KEY") )
                .modelName("wanx2.1-t2i-turbo")
                .build();

        Response<Image> response=wanxImageModel.generate("一只很可爱的猫在草地上玩");
        System.out.println(response.content().url() );

    }
}
